Skip to content

Add beginner topics and improve search discovery and loading - #25

Merged
msmfa merged 4 commits into
masterfrom
term-schema-and-deferred-analytics
Sep 30, 2026
Merged

msmfa merged 4 commits into
masterfrom
term-schema-and-deferred-analytics

Conversation

@msmfa

@msmfa msmfa commented Sep 11, 2026 •

Copy link
Copy Markdown
Owner

The reference was missing five common beginner topics, and concept pages downloaded the optional AI interface even when it stayed closed. This change adds arrays, objects, if/else, DOM, and events, and loads the AI panel only when opened.

All five new definitions stay under 30 words and include tested examples. The original 35 definitions and URLs are preserved. The homepage, navigation, and sitemap now cover 40 concepts.

Search and loading improvements:

  • Add DefinedTerm, DefinedTermSet, and TechArticle structured data alongside the existing page metadata and breadcrumbs.
  • Improve the homepage heading and description, and expose MDN references outside the AI panel.
  • Generate llms.txt from the same definitions, with canonical links and discovery links in the HTML. Existing crawler permissions remain unchanged.
  • Reduce initial first-party JavaScript from 21,817 to 6,777 bytes by loading AI on demand.
  • Load analytics vendor bundles after page load during idle time, while initializing event queues immediately. Visitors who leave before the vendor bundles arrive may go uncounted.

The current master branch is merged in, preserving the newer README wording and Practice Pad link. Detailed maintenance notes live in docs/maintenance.md.

Validation:

  • Clean npm ci completed with no reported vulnerabilities.
  • All 86 tests pass, including every code example, metadata, internal links, sitemap, LLM index, lazy loading, and the initial JavaScript size budget.
  • Production build generates all 40 concept pages.
  • Lighthouse 13.5.0 scored 100 for performance, accessibility, best practices, and SEO on five tested local mobile/desktop page combinations. Local analytics are disabled, so these are not production score guarantees. The live baseline scored 96–98 performance and 100 in the other categories.
  • AI panel and connection dialog verified in the browser. Audit details are in docs/lighthouse-audit.md.

The graph on every page described only where a page sat: WebSite, WebPage
and a BreadcrumbList. Nothing said what a page held, so a concept page and
any other page looked like the same kind of thing to a crawler.

Each concept now adds a DefinedTerm carrying the short definition, pointing
at the MDN page for the same term through sameAs, and claiming membership of
a DefinedTermSet that the home page declares over all thirty-five concepts.
A TechArticle wraps the prose around it, with the proficiency level taken
from the existing Fundamentals and Advanced split and the modified date from
the same content commit the sitemap already uses.

This matters more for assistants answering "what is a closure in JavaScript"
than for blue links: a page that names itself the definition of a term is far
easier to identify as the source than one that only names itself a page.
Consent already granted meant gtag.js and PostHog's array.js were injected
the moment the module ran. Both are async, so neither blocked rendering, but
a quarter of a megabyte of parse work competed with the main thread while it
was still painting. Lighthouse put element render delay at 1.1s inside a
mobile LCP of 3.8s, and 120 KiB of the two bundles never executed at all.

Nothing either vendor does matters before the page is visible, and both are
built to be started late: gtag buffers through dataLayer and PostHog through
its _i stub queue. So the shims, the config call and the stub still run
synchronously, and only the two script injections move behind an idle
callback after load. The page view is still queued at the moment it happens
rather than when the bundles land.

The idle deadline is 1500ms: long enough to clear the paint, short enough
that a quick bounce is still recorded. Safari below 16.4 has no
requestIdleCallback and falls back to a timer, which by then is also clear
of the paint.
@msmfa msmfa changed the title Declare concepts as defined terms, and stop analytics blocking the paint Add beginner topics and improve search discovery and loading Sep 30, 2026
@msmfa
msmfa merged commit e188f0f into master Sep 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant